package group2assignone.ucm.customer;

import group2assignone.model.Customer;
import group2assignone.ucm.UCController;
import group2assignone.view.OurView;
import group2assignone.view.customer.CustomerEditView;

/**
 * Use Case to show the 'Customer Edit' view
 * @author group2
 */
public class UCUICustomerEdit implements UCController {

    private OurView view;
    private Customer customer;

    /**
     * assigns view and customer
     * @param view
     * @param customer
     */
    public UCUICustomerEdit(OurView view, Customer customer) {
        this.view = view;
        this.customer = customer;
    }

    /**
     * Use Case: Change UI to Search Flights
     * 1. system exits current view
     * 2. system updates gui to the search flights UI
     */
    public void run() {
        CustomerEditView gui = new CustomerEditView(customer);
        gui.go();
        view.dispose();
    }
}
